package com.dsp.sharding.order.dao;


import com.dsp.sharding.order.entity.Order;
import org.springframework.data.jdbc.repository.query.Modifying;
import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface OrderDao extends PagingAndSortingRepository<Order,Long> {

    @Modifying
    @Query("insert into t_order(id, order_sn, user_id, user_name) values(:id,:orderSn,:userId,:userName)")
    int insert(@Param("id")Long id,String orderSn, Long userId, String userName);
}